package com.example.gxwmvp;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.example.gxwmvp.presenter.BasePresenter;


import java.util.List;

public abstract class BaseActivity<V,T extends BasePresenter<V>> extends AppCompatActivity {
    T mPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter = createPresenter();
        mPresenter.attachView((V)this);
    }

    protected abstract T createPresenter();

    @Override
    protected void onDestroy() {
        mPresenter.deAttachView();
        super.onDestroy();
    }
}
